#include <iostream>
#include <string>
  
struct test0{
  int a,b;
};
extern "C" {
	  char foo(int, double);
	  char c(char);
	  int min(int,double);
	  int max(int,double);
	  int sum(int,int);
	  int fib(int);
	  char *isNegative(int);
	  int testBlock(void);
	  char *testStruct(test0);
	  char *testBool();
}
// bool myprint(char * s){
//   std::cout << "Hello " << s << "\n";
//   return true;
// }
void testString(){
  std::cout << "-1 is " << isNegative(-1) << std::endl;
  std::cout << "0 is " << isNegative(0) << std::endl;
  std::cout << "1 is " << isNegative(1) << std::endl;
}
void testFib(){
  for(int i = 0; i < 6;i++)
    std::cout << "fib " << i << " is " << fib(i) << std::endl;
}
void testMin(){
  std::cout << "min of 1, 4.2 is :" << min(1,4.2) << std::endl;
  std::cout << "min of 5, 4.0 is :" << min(3,4.0) << std::endl;
  std::cout << "max of 1, 4.2 is :" << max(1,4.2) << std::endl;
  std::cout << "max of 5, 4.0 is :" << max(3,4.0) << std::endl;
}
int main(){
	std::cout << "foo of 1, 4.2 is " << foo(1,4.2) << std::endl;
	std::cout << "foo of 3, 4.0 is " << foo(3,4.0) << std::endl;
	testString();
	testFib();
	std::cout << "c of 'A' is "<<c('A') << std::endl;
	std::cout << "sum of 1, 50 is " << sum(1,50) << std::endl;
	std::cout << "sum of 1, 100 is " << sum(1,100) << std::endl;
	std::cout << "testBlock should return 1,real return is " << testBlock() << std::endl;
	test0 *t0 = new test0();
	t0->a = 1;
	t0->b = 2;
	std::cout << "testStruct : " << testStruct(*t0) << std::endl;
	delete t0;
	std::cout << "testBool : " << testBool() << std::endl;
}

